package com.example.micrdataservice.controller;

import com.example.micrapi.pojo.SysUser;
import com.example.micrdataservice.mapper.SysUserMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: TODO
 * @author: uu
 * @date: 2024/2/28 21:46
 * @version: 1.0
 */
@Tag(name="sysUser", description = "用户信息")
@RequestMapping("/dataservice/sysUser")
@RestController
public class SysUserController {

    @Autowired
    private SysUserMapper sysUserMapper;
    @Operation(summary = "")
    @GetMapping("/findByUserName")
    public SysUser findByUsername(@RequestParam("username") String username,
                                  @RequestParam("type") int type) {
        return sysUserMapper.selectByUserName(username, type);
    }
    @PostMapping("/updateLastTime")
    Boolean updateLastTime(@RequestBody SysUser sysUser) {
        return sysUserMapper.updateLastTimeByPrimaryKey(sysUser) == 1;
    }

}
